<?php

use Illuminate\Support\Facades\Route;
// use App\Http\Controllers\Test;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', [Test::class, 'index']);

Route::get('/', 'Test@index');     // RouteServiceProvider 中解除注释$namespace

Route::group(['middleware'=>'login'], function() {
    Route::get('/admin', 'admin\Index@index');
    Route::get('/admin/welcome', 'admin\Index@welcome');
    Route::get('/admin/logout', 'admin\Login@logout');
    Route::resource('/admin/swiper', 'admin\Swiper');
    Route::post('/admin/swiper/upload', 'admin\Swiper@upload');    // 上传图片
    Route::get('/admin/get_swipers', 'admin\Swiper@getSwiper');
    Route::resource('/admin/category', 'admin\Category');
    Route::get('/admin/get_cats', 'admin\Category@getCategory');
    Route::resource('/admin/course', 'admin\Course');
    Route::get('/admin/get_course', 'admin\Course@getCourse');
    Route::post('/admin/course/upload', 'admin\Course@upload');
    Route::post('/admin/course/upIntroImg', 'admin\Course@upIntroImg');
});




Route::match(['get','post'],'/admin/login', 'admin\Login@index');


// Route::view('/welcome', 'article/index', ['username' => '船只']);